cmake_minimum_required(VERSION 3.16)
project(btpingpong LANGUAGES CXX)

 set(CMAKE_CXX_STANDARD 11)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)

 set(CMAKE_AUTOMOC ON)
 set(CMAKE_AUTORCC ON)
 set(CMAKE_AUTOUIC ON)

 if(CMAKE_VERSION VERSION_LESS "3.7.0")
     set(CMAKE_INCLUDE_CURRENT_DIR ON)
 endif()

find_package(Qt5 REQUIRED COMPONENTS Bluetooth Core Gui Quick)

add_executable(btpingpong
    main.cpp
    pingpong.cpp pingpong.h res1.qrc
)

set_target_properties(btpingpong PROPERTIES
    WIN32_EXECUTABLE TRUE
    MACOSX_BUNDLE TRUE
    OUTPUT_NAME "pingpong.exe"
)

set_target_properties(btpingpong
    PROPERTIES
    LINK_FLAGS -no-pie
    )
target_link_libraries(btpingpong Qt::Bluetooth
    Qt::Core
    Qt::Gui
    Qt::Quick)
